package com.bdc.whatwhat.fragments.APropos;

import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bdc.whatwhat.R;
import com.bdc.whatwhat.adapters.ViewPagerAdapter;
import com.bdc.whatwhat.fragments.core.WWFragment;
import com.viewpagerindicator.UnderlinePageIndicator;

/**
 * Created by dev-w8-gfi on 20/06/2014.
 */
public class AProposFragment extends WWFragment {

    View view;
    Context context;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        view = inflater.inflate(R.layout.fragment_a_propos, container, false);

        context = inflater.getContext();

        charger();
        remplir();
        ajouterListeners();

        return view;
    }

    public static AProposFragment newInstance() {
        return new AProposFragment();
    }

    static void brandGlowEffect(Context context, int brandColor) {
        int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
        Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
        androidGlow.setColorFilter(brandColor, PorterDuff.Mode.MULTIPLY);
    }

    private void charger() {

        getSherlockActivity().getSupportActionBar().setTitle(getResources().getString(R.string.a_propos));

        ViewPager pager = (ViewPager) view.findViewById(R.id.pager);

        pager.setAdapter(new ViewPagerAdapter(getChildFragmentManager()));
        //pager.getAdapter().notifyDataSetChanged();

        UnderlinePageIndicator titleIndicator = (UnderlinePageIndicator) view.findViewById(R.id.indicator);
        titleIndicator.setViewPager(pager);

        brandGlowEffect(getActivity(), Color.parseColor("#FFFFFF"));
    }

    private void remplir() {
    }


    private void ajouterListeners() {
    }


}
